//<<<+++OPENSOURCE
//<<<+++OPENSOURCE_LICENSE
/**
 * @addtogroup FXCODEC
 * @{
 */

//<<<+++OPENSOURCE_MUST_BEGIN
/**
 * @file
 * @brief Basic macros and enumerations of fx_codec
 */
#ifndef _FX_CODEC_DEF_H_
#define _FX_CODEC_DEF_H_
//<<<+++OPENSOURCE_MUST_END

/**
 * @name Enumerations used for ICodec_ProgressiveDecoder
 */
/*@{*/

//<<<+++OPENSOURCE_BEGIN LIC==FOXIT
/** @brief Define the various image type */
enum FXCODEC_IMAGE_TYPE
{
	FXCODEC_IMAGE_UNKNOWN = 0,			/**< Unknown image, will be auto detected */
	FXCODEC_IMAGE_BMP,					/**< Bmp */
	FXCODEC_IMAGE_JPG,					/**< Jpeg */
	FXCODEC_IMAGE_PNG,					/**< Png */
	FXCODEC_IMAGE_GIF,					/**< Gif */
	FXCODEC_IMAGE_TIF,					/**< Tiff */
	FXCODEC_IMAGE_MAX					/**< Max, the upperbound of image enum. */
};
//<<<+++OPENSOURCE_END

/** @brief Define the codec status. */
enum FXCODEC_STATUS
{
	FXCODEC_STATUS_ERROR = -1,			/**< any error */
	FXCODEC_STATUS_FRAME_READY,			/**< load image info finish, the status is ready for loading frame */
	FXCODEC_STATUS_FRAME_TOBECONTINUE,	/**< the load frames must be continue */
	FXCODEC_STATUS_DECODE_READY,		/**< load frames finish, the decoder is ready */
	FXCODEC_STATUS_DECODE_TOBECONTINUE,	/**< the decoder must be continue */
	FXCODEC_STATUS_DECODE_FINISH,		/**< decode finish */
	FXCODEC_STATUS_ERR_MEMORY,			/**< memory not enough */
	FXCODEC_STATUS_ERR_READ,			/**< file read error */
	//<<<+++OPENSOURCE_BEGIN LIC==FOXIT
	FXCODEC_STATUS_ERR_WRITE,			/**< file write error */
	//<<<+++OPENSOURCE_END
	FXCODEC_STATUS_ERR_FLUSH,			/**< file flush error */
	FXCODEC_STATUS_ERR_FORMAT,			/**< image format error or not support */
	FXCODEC_STATUS_ERR_PARAMS			/**< the input parameters do not come up to the requirements */
};

/*@}*/

/**
 * @name Flags used for JPX Encoder
 */
/*@{*/

/** @brief Color space */
#define JP2_SPACE_INVALID	-1
#define JPX_SPACE_INVALID	-1
#define JP2_SPACE_bilevel1	0
#define JP2_SPACE_YCbCr1	1
#define JP2_SPACE_YCbCr2	3
#define JP2_SPACE_YCbCr3	4
#define JP2_SPACE_PhotoYCC	9
#define JP2_SPACE_CMY		11
#define JP2_SPACE_CMYK		12
#define JP2_SPACE_YCCK		13
#define JP2_SPACE_CIELab	14
#define JP2_SPACE_bilevel2	15
#define JP2_SPACE_sRGB		16 /**< The standard RGB space */
#define JP2_SPACE_sLUM		17 /**< The standard luminance space (same gamma as sRGB) */
#define JP2_SPACE_sYCC		18 /**< YCC derivative of sRGB */
#define JP2_SPACE_CIEJab	19
#define JP2_SPACE_esRGB		20
#define JP2_SPACE_ROMMRGB	21
#define JP2_SPACE_YPbPr60	22
#define JP2_SPACE_YPbPr50	23
#define JP2_SPACE_esYCC		24
#define JP2_SPACE_iccLUM	100 /**< Mono space described by restricted ICC profile */
#define JP2_SPACE_iccRGB	101 /**< 3-colour space given by restricted ICC profile */

//<<<+++OPENSOURCE_BEGIN LIC==FOXIT
/** @brief Illuminant */
#define JP2_ILLUMINANT_D50	0 /**< illuminant_is_D50 */
#define JP2_ILLUMINANT_D65	1

/** @brief Progression order*/
#define JPX_COD_ORDER_LRCP	0
#define JPX_COD_ORDER_RLCP	1
#define JPX_COD_ORDER_RPCL	2
#define JPX_COD_ORDER_PCRL	3
#define JPX_COD_ORDER_CPRL	4
//<<<+++OPENSOURCE_END

/*@}*/

/**
 * @name Flags used for ICodec_IccModule
 */
/*@{*/

/** @brief Rendering intent */
#define Icc_INTENT_PERCEPTUAL				0
#define Icc_INTENT_RELATIVE_COLORIMETRIC	1
#define Icc_INTENT_SATURATION				2
#define Icc_INTENT_ABSOLUTE_COLORIMETRIC	3

/** @brief Format Flags */
#define Icc_FORMAT_DEFAULT					0
#define Icc_FORMAT_SWAP						(1<<10)		/**< Do swap? ie, BGR, KYMC. */

/** @brief Transform and proofing Flags */
#define Icc_FLAGS_DEFAULT					0x0000
#define Icc_FLAGS_BLACKPOINTCOMPENSATION	0x2000
#define Icc_FLAGS_NOWHITEONWHITEFIXUP		0x0004		/**< Don't fix scum dot */
#define Icc_FLAGS_HIGHRESPRECALC			0x0400		/**< Use more memory to give better accurancy */
#define Icc_FLAGS_LOWRESPRECALC				0x0800		/**< Use less memory to minimize resources */

#define Icc_FLAGS_GAMUTCHECK				0x1000		/**< Out of Gamut alarm */
#define Icc_FLAGS_SOFTPROOFING				0x4000		/**< Do soft proofing */

/** @brief IccParam Types */
#define Icc_PARAMTYPE_NONE					0			/**< Don't use any icc transform. */
#define Icc_PARAMTYPE_BUFFER				1			/**< Use the pProfileData in IccParam. */
#define Icc_PARAMTYPE_PARAM					2			/**< Use custom param in IccParam, such as Gamma. */

/*@}*/

/**
 * @brief Define the resolution unit type.
 */
/*@{*/
//<<<+++OPENSOURCE_BEGIN LIC==FOXIT
enum FXCODEC_RESUNIT
{
	FXCODEC_RESUNIT_NONE = 0,		///< no unit
	FXCODEC_RESUNIT_INCH,			///< unit inch
	FXCODEC_RESUNIT_CENTIMETER,		///< unit centimeter
	FXCODEC_RESUNIT_METER			///< unit meter
};

/*@}*/

/**
 * @breif The compress type of BMP file data.
 */
/*@{*/
#define BMP_COMPRESS_RGB		0		/**< Copy the source data from source dib without any compression. */
#define BMP_COMPRESS_RLE8		1		/**< RLE compress type for FXDIB_8bppRgb(a) format, the palette of source dib should be exist. */
#define BMP_COMPRESS_RLE4		2		/**< Like COMPRESS_RLE8, but the color of source dib should be less than 16. */
#define BMP_COMPRESS_BITFIELDS	3		/**< Only used for 24/32 bit dib. No palette, 2 bytes per pixel. */
/*@}*/
//<<<+++OPENSOURCE_END

/**
 * @breif The exif information of camera in JPEG file.
 */
/*@{*/
#define EXIFTAG_USHORT_RESUNIT				296		/**< Resolution unit. The value type is a 16-bit unsigned integer(FX_WORD). */
#define EXIFTAG_FLOAT_DPIX					282		/**< Image resolution in width. The value type is 32 bits(FX_FLOAT). */
#define EXIFTAG_FLOAT_DPIY					283		/**< Image resolution in width. The value type is 32 bits(FX_FLOAT). */
#define EXIFTAG_USHORT_ORIENTATION			274		/**< The orientation. The value type is a 16-bit unsigned integer(FX_WORD). */
#define EXIFTAG_STRING_MANUFACTURER			271		/**< Digital camera manufacturers. The value type is an 8- bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL(FX_LPSTR). The caller should not release the string. */
#define EXIFTAG_STRING_MODULE				272		/**< Digital camera module code. The value type is an 8- bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL(FX_LPSTR). The caller should not release the string. */
#define EXIFTAG_STRING_SOFTWARE				305		/**< Software used. The value type is an 8- bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL(FX_LPSTR). The caller should not release the string. */
#define EXIFTAG_STRING_IAMGEDESCRIPTION		270		/**< The description of bitmap. Don't support double byte characters yards, like Chinese/Japanese/Korean etc. The value type is an 8- bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL(FX_LPSTR). The caller should not release the string. */
#define EXIFTAG_STRING_DATETIME				306		/**< File change date and time. The value type is an 8- bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL(FX_LPSTR). The caller should not release the string. */
#define EXIFTAG_STRING_COPYRIGHT			33432	/**< Copyright holder. The value type is an 8- bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL(FX_LPSTR). The caller should not release the string. */
/*@}*/

//<<<+++OPENSOURCE_MUST_BEGIN
#endif//_FX_CODEC_DEF_H_
//<<<+++OPENSOURCE_MUST_END

/** @} */

